#include "scriptdialog.h"

ScriptDialog::ScriptDialog(QWidget *parent) :
    QDialog(parent)
{
    setWindowTitle(tr("Script Window"));

    runButton.setText(tr("Run"));
    formLayout.addRow(&cmdText);
    cmdText.setReadOnly(true);
    cmdText.setFixedSize(578,423);
    hlayout.addWidget(&cmdLineEdit);
    hlayout.addWidget(&runButton);
    formLayout.addRow(&hlayout);

    setFixedSize(600,480);
    setLayout(&formLayout);

    connect(&runButton, SIGNAL(clicked()), this, SLOT(runButtonclicked()));
}

ScriptDialog::~ScriptDialog()
{

}

void ScriptDialog::runButtonclicked()
{
    if(!cmdLineEdit.text().isEmpty())
    {
        cmdText.appendPlainText(cmdLineEdit.text());
        //excute command here
    }
}
